package com.wali.modules.usr.bo;

import com.wali.modules.usr.vo.UsrReceiverVO;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author walixu
 * @ClassName com.wali.modules.common.vo
 * @Description 收件人信息BO类
 * @email wali.xu@kpmg.com
 * @date 19/01/2019 2:14 下午
 */
public class UsrReceiverBO implements Serializable {

    /**
     * 主键
     */
    private int id;

    /**
     * 用户ID
     */
    private int userId;

    /**
     * 仓库名称
     */
    private String receiverName;

    /**
     * 电话
     */
    private String receiverTelphone;

    /**
     * 国家
     */
    private String country;

    /**
     * 省份
     */
    private String province;

    /**
     * 城市
     */
    private String city;

    /**
     * 地址
     */
    private String receiverAddr;

    /**
     * 邮编
     */
    private String postcode;

    /**
     * 身份证
     */
    private String idCard;

    /**
     * 身份证正面
     */
    private String idCardFront;

    /**
     * 身份证反面
     */
    private String idCardBack;

    /**
     * 创建时间
     */
    private String createTime;

    /**
     * 更新时间
     */
    private String updateTime;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getReceiverName() {
        return receiverName;
    }

    public void setReceiverName(String receiverName) {
        this.receiverName = receiverName;
    }

    public String getReceiverTelphone() {
        return receiverTelphone;
    }

    public void setReceiverTelphone(String receiverTelphone) {
        this.receiverTelphone = receiverTelphone;
    }

    public String getReceiverAddr() {
        return receiverAddr;
    }

    public void setReceiverAddr(String receiverAddr) {
        this.receiverAddr = receiverAddr;
    }

    public String getPostcode() {
        return postcode;
    }

    public void setPostcode(String postcode) {
        this.postcode = postcode;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(String updateTime) {
        this.updateTime = updateTime;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getIdCard() {
        return idCard;
    }

    public void setIdCard(String idCard) {
        this.idCard = idCard;
    }

    public String getIdCardFront() {
        return idCardFront;
    }

    public void setIdCardFront(String idCardFront) {
        this.idCardFront = idCardFront;
    }

    public String getIdCardBack() {
        return idCardBack;
    }

    public void setIdCardBack(String idCardBack) {
        this.idCardBack = idCardBack;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        UsrReceiverBO that = (UsrReceiverBO) o;
        return id == that.id &&
                userId == that.userId &&
                Objects.equals(receiverName, that.receiverName) &&
                Objects.equals(receiverTelphone, that.receiverTelphone) &&
                Objects.equals(country, that.country) &&
                Objects.equals(province, that.province) &&
                Objects.equals(city, that.city) &&
                Objects.equals(receiverAddr, that.receiverAddr) &&
                Objects.equals(postcode, that.postcode) &&
                Objects.equals(idCard, that.idCard) &&
                Objects.equals(idCardFront, that.idCardFront) &&
                Objects.equals(idCardBack, that.idCardBack) &&
                Objects.equals(createTime, that.createTime) &&
                Objects.equals(updateTime, that.updateTime);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, userId, receiverName, receiverTelphone, country, province, city, receiverAddr, postcode, idCard, idCardFront, idCardBack, createTime, updateTime);
    }

    /**
     * @param
     * @return
     * @throws
     * @Title convert
     * @Description 将UsrReceiverBO转化为UsrReceiverVO
     */
    public static UsrReceiverVO convert(UsrReceiverBO usrReceiver) {
        UsrReceiverVO temp = new UsrReceiverVO();
        temp.setAddr(usrReceiver.getReceiverAddr());
        temp.setCity(usrReceiver.getCity());
        temp.setCountry(usrReceiver.getCountry());
        temp.setCreateTime(usrReceiver.getCreateTime());
        temp.setIdCard(usrReceiver.getIdCard());
        temp.setId(usrReceiver.getId());
        temp.setIdCardBack(usrReceiver.getIdCardBack());
        temp.setIdCardFront(usrReceiver.getIdCardFront());
        temp.setName(usrReceiver.getReceiverName());
        temp.setPostcode(usrReceiver.getPostcode());
        temp.setProvince(usrReceiver.getProvince());
        temp.setUserId(usrReceiver.getUserId());
        temp.setTelphone(usrReceiver.getReceiverTelphone());
        temp.setUpdateTime(usrReceiver.getUpdateTime());
        return temp;

    }

    @Override
    public String toString() {
        return "UsrReceiverBO{" +
                "id=" + id +
                ", userId=" + userId +
                ", receiverName='" + receiverName + '\'' +
                ", receiverTelphone='" + receiverTelphone + '\'' +
                ", country='" + country + '\'' +
                ", province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", receiverAddr='" + receiverAddr + '\'' +
                ", postcode='" + postcode + '\'' +
                ", idCard='" + idCard + '\'' +
                ", idCardFront='" + idCardFront + '\'' +
                ", idCardBack='" + idCardBack + '\'' +
                ", createTime='" + createTime + '\'' +
                ", updateTime='" + updateTime + '\'' +
                '}';
    }
}
